package com.ruoyi.business.domain.enums;

import lombok.Getter;

@Getter
public enum GradeLevelEnum {
    GRADE_1("1","优秀"),
    GRADE_2("2","良好"),
    GRADE_3("3","及格"),
    GRADE_4("4","不及格");

    private final String code;
    private final String value;

    GradeLevelEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public static GradeLevelEnum getGrade(String code) {
        for (GradeLevelEnum grade : GradeLevelEnum.values()) {
            if (grade.getCode().equals(code)) {
                return grade;
            }
        }
        return null;
    }
}